Name "Canol's Movie Archiver"
outFile "cma_setup.exe"

InstallDir "$PROGRAMFILES\Canol\Movie Archiver"

LicenseText "You must agree to this license before installing."
LicenseData "nsis\LICENSE"

Page License
Page Directory
Page InstFiles

UninstPage UninstConfirm
UninstPage InstFiles

Section

    SetOutPath "$INSTDIR"

    file /r "nsis\"

    writeUninstaller $INSTDIR\uninstall.exe

    CreateDirectory "$SMPROGRAMS\Canol"
    CreateDirectory "$SMPROGRAMS\Canol\Movie Archiver"
    
    CreateShortCut "$SMPROGRAMS\Canol\Movie Archiver\Movie Archiver.lnk" "$INSTDIR\movie_archiver.exe"
    CreateShortCut "$SMPROGRAMS\Canol\Movie Archiver\Uninstall.lnk" "$INSTDIR\uninstall.exe"
    CreateShortCut "$DESKTOP\Movie Archiver.lnk" "$INSTDIR\movie_archiver.exe"
    
SectionEnd

Section "Uninstall"

    delete "$INSTDIR\uninstall.exe"
    delete "$INSTDIR\canols_movie_archiver.exe"
    RMDir /r "$INSTDIR"
    RMDir "$PROGRAMFILES\Canol"
    delete "$SMPROGRAMS\Canol\Movie Archiver\Movie Archiver.lnk"
    delete "$SMPROGRAMS\Canol\Movie Archiver\Uninstall.lnk"
    RMDir "$SMPROGRAMS\Canol\Movie Archiver"
    RMDir "$SMPROGRAMS\Canol"
    delete "$DESKTOP\Movie Archiver.lnk"

SectionEnd